package com.test.controller;

import com.github.pagehelper.PageInfo;
import com.test.entity.Orders;
import com.test.entity.OrdersItem;
import com.test.service.OrdersItemService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@RequestMapping("/admin/ordersItem")
public class OrdersItemController {

    @Resource
    private OrdersItemService ordersItemService;


    @GetMapping("/getOrdersItemList/{oid}")
    public String getOrdersList(@PathVariable("oid") int orderID,Model model) {
        OrdersItem oi = new OrdersItem();
        oi.setOrderId(orderID);
        List<OrdersItem> ordersItemList = ordersItemService.queryByoID(oi);
        model.addAttribute("ordersItemList",ordersItemList);

        return "ordersItemList";
    }
}

